package com.pattern.command.tenant;

import com.pattern.command.frame.Command;
import com.pattern.command.third.Service1;

public class Command1 implements Command {

    private String userName;

    public Command1(String userName) {
        this.userName = userName;
    }

    @Override
    public boolean execute() {
        // 此处跨服务调用Service1的RPC业务接口
        return Service1.createUser(userName);
      }

    @Override
    public boolean undo() {
        // 此处跨服务调用Service1的RPC业务接口的逆向undo接口
        return Service1.deleteUser(userName);
    }
}
